package com.property.demo.dto;

import com.property.demo.model.Parking;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
public class ParkingDTO {
    private Long id;
    private String name;
    private Long communityId;
    private String communityName;
    private String type;
    private String status;
    private Double area;
    private Double price;
    private Date createdAt;
    private Date updatedAt;
    
    public ParkingDTO(Parking parking) {
        this.id = parking.getId();
        this.name = parking.getName();
        if (parking.getCommunity() != null) {
            this.communityId = parking.getCommunity().getId();
            this.communityName = parking.getCommunity().getName();
        }
        this.type = parking.getType();
        this.area = parking.getArea();
        this.status = parking.getStatus();
        this.price = parking.getPrice();
        this.createdAt = parking.getCreatedAt();
        this.updatedAt = parking.getUpdatedAt();
    }
} 